#coding:utf-8
import pickle
def log_in():
    file = open("data.txt", "rb")
    the_data_base = pickle.load(file)
    file.close()
    name = list(the_data_base.keys())
    passwd = list(the_data_base.values())
    count = 0
    while count < 3:
        user_name = str(input("请输入你的用户名："))  #打算把所有的用户名密码什么的都当作字符串来处理，免得有整数什么的太麻烦
        user_passwd = str(input(("请输入你的密码：")))
        if user_name in name and user_passwd in passwd:
            print("\n成功登陆！")
            break
        else:
            print("\n用户名或者密码错误，你只有三次机会！")
        count +=1


